package com.neuedu.demo3;

import java.util.Scanner;

public class Homework14 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个任意的4位整数");
        int num = sc.nextInt();
        int ge = num % 10;//求个位
        int shi = num / 10 % 10;//求十位
        int bai = num / 100 % 10;//求百位
        int qian = num / 1000 % 10;//秋=求千位
        int result = ge * 1000 + shi * 100 + bai * 10 + qian;//倒着进行拼接
        System.out.println(result);
    }
}
